package com.yuneec.fly.utils;

import android.app.FragmentManager;

import com.yuneec.fly.dialogs.AmapOfflineDeleteDialog;
import com.yuneec.fly.dialogs.BaseDialogFragment;
import com.yuneec.fly.dialogs.ConfirmDialog;
import com.yuneec.fly.dialogs.ConfirmDialogWithoutSeekbar;
import com.yuneec.fly.dialogs.ConfirmWayPointDialog;
import com.yuneec.fly.dialogs.LoginWifiDialog;
import com.yuneec.fly.dialogs.WarningDialog;

/**
 * Created by jw.gu on 2016/6/14.
 */
public class DialogHelper {

    public static ConfirmDialogWithoutSeekbar showConfirmDialogWithoutSeekbar(FragmentManager fragmentManager, String message, final BaseDialogFragment.OnConfirmListener onConfirmListener) {
        return showConfirmDialogWithoutSeekbar(fragmentManager, message, onConfirmListener, null);
    }

    public static ConfirmDialog showConfirmDialog(FragmentManager fragmentManager, String message, final BaseDialogFragment.OnConfirmListener onConfirmListener) {
        return showConfirmDialog(fragmentManager, message, onConfirmListener, null);
    }

    public static ConfirmWayPointDialog showConfirmWayPointDialog(FragmentManager fragmentManager, String message, final BaseDialogFragment.OnConfirmListener onConfirmListener) {
        return showConfirmWayPointDialog(fragmentManager, message, onConfirmListener, null);
    }

    public static ConfirmDialogWithoutSeekbar showConfirmDialogWithoutSeekbar(FragmentManager fragmentManager, String message, final BaseDialogFragment.OnConfirmListener onConfirmListener, final BaseDialogFragment.OnCancelListener onCancelListener) {
        ConfirmDialogWithoutSeekbar confirmDialog = new ConfirmDialogWithoutSeekbar(message, onConfirmListener, onCancelListener);
        confirmDialog.show(fragmentManager, "ConfirmDialogWithoutSeekbar");
        return confirmDialog;
    }

    public static ConfirmDialog showConfirmDialog(FragmentManager fragmentManager, String message, final BaseDialogFragment.OnConfirmListener onConfirmListener, final BaseDialogFragment.OnCancelListener onCancelListener) {
        ConfirmDialog confirmDialog = new ConfirmDialog(message, onConfirmListener, onCancelListener);
        confirmDialog.show(fragmentManager, "ConfirmDialog");
        return confirmDialog;
    }

    public static ConfirmWayPointDialog showConfirmWayPointDialog(FragmentManager fragmentManager, String message, final BaseDialogFragment.OnConfirmListener onConfirmListener, final BaseDialogFragment.OnCancelListener onCancelListener) {
        ConfirmWayPointDialog confirmDialog = new ConfirmWayPointDialog(message, onConfirmListener, onCancelListener);
        confirmDialog.show(fragmentManager, "ConfirmDialog");
        return confirmDialog;
    }

    public static WarningDialog showWarningDialog(FragmentManager fragmentManager, String message) {
        WarningDialog warningDialog = new WarningDialog(message);
        warningDialog.show(fragmentManager, "WarningDialog");
        return warningDialog;
    }

    public static LoginWifiDialog showLoginWifiDialog(FragmentManager fragmentManager, String ssid, final LoginWifiDialog.OnConfirmListener onConfirmListener, final BaseDialogFragment.OnCancelListener onCancelListener) {
        LoginWifiDialog loginWifiDialog = new LoginWifiDialog(ssid, onConfirmListener, onCancelListener);
        loginWifiDialog.show(fragmentManager, "LoginWifiDialog");
        return loginWifiDialog;
    }

    public static AmapOfflineDeleteDialog showAmapOfflineDeleteDialog(FragmentManager fragmentManager, String name, boolean showUpdate, final AmapOfflineDeleteDialog.OnDeleteListener onDeleteListener, final AmapOfflineDeleteDialog.OnCheckUpdateListener onCheckUpdateListener) {
        AmapOfflineDeleteDialog amapOfflineDeleteDialog = new AmapOfflineDeleteDialog(name, showUpdate, onDeleteListener, onCheckUpdateListener);
        amapOfflineDeleteDialog.show(fragmentManager, "AmapOfflineDeleteDialog");
        return amapOfflineDeleteDialog;
    }
}
